import React, { Component } from 'react';

import { user_goodlist } from '../../utils/api';
class MySeckill extends Component {
    constructor(props){
        super(props);
        this.state={
            goodlist:[]
        }
    }
    componentDidMount(){
        user_goodlist({page:2,count:10}).then((res)=>{
            if(res.data.code===200){
                
                this.setState({
                    goodlist:res.data.list
                    
                })
            }
        })
    }
    render() {
        return (
            <div className='MySeckill'>
                {
                    this.state.goodlist.map((item,index)=>{
                        return(
                            <div className='MySeckill_1' key={index}>
                                <img src={item.pic} alt="" />
                                <div className='name'>{item.name}</div>
                                <p className='P1'>原价¥303</p>
                                <p className='p2'>抢购价 <span>¥{item.salesPrice.value}</span></p>
                            </div>
                        )
                    })
                }
                
            </div>
        );
    }
}

export default MySeckill;